package main

import (
	"fmt"
	"strings"
)

// 列出环境配置
func handleList() {
	output, err := runGit("stash", "list")
	if err != nil || strings.TrimSpace(output) == "" {
		fmt.Println("没有保存的环境配置")
		return
	}

	fmt.Println("环境列表:")
	lines := strings.Split(output, "\n")
	for i, line := range lines {
		if parts := strings.SplitN(line, ": ", 3); len(parts) >= 3 {
			fmt.Printf("环境 %d: %s\n", i, parts[2])
		}
	}
}
